<?php
/**
 * Created by PhpStorm.
 * User: ari
 * Date: 9/26/14
 * Time: 4:24 PM
 */
namespace BC\User\Exceptions;

use CPath\Data\Map\IKeyMap;
use CPath\Data\Map\IKeyMapper;
use CPath\Response\IResponse;

class ChallengeException extends LoginException implements IKeyMap
{
    const STR_CHALLENGE = 'challenge';
    private $mEncryptedStr;

    public function __construct($message, $encryptedStr)
    {
        parent::__construct($message);
        $this->mEncryptedStr = $encryptedStr;
    }

    public function getEncryptedString() {
        return $this->mEncryptedStr;
    }

	/**
	 * Map data to a data map
	 * @param IKeyMapper $Map the map inst to add data to
	 * @internal param \CPath\Request\IRequest $Request
	 * @internal param \BC\User\Exceptions\IRequest $Request
	 * @return void
	 */
    function mapKeys(IKeyMapper $Map) {
        $Map->map(IResponse::STR_CODE, $this->getCode());
        $Map->map(IResponse::STR_MESSAGE, $this->getMessage());
        $Map->map(self::STR_CHALLENGE, $this->getEncryptedString());
    }
}